package cn.sdack.go.users.dao;

import cn.sdack.go.common.entities.users.UserAuthorityEntity;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * @author sdack
 * @date 2024/1/8
 */
public interface UserAuthorityDao extends JpaRepository<UserAuthorityEntity,Long> {

    List<UserAuthorityEntity> findAllByUserId(long userId);

    List<UserAuthorityEntity> findAllByCodeGidAndAuthorityCode(Long gid,String code);

    Long deleteByUserIdAndAuthorityCodeStartingWith(long userId, String code);


}
